package com.ikas.ai.server.module.appraise.tdDao;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ikas.ai.server.module.data.model.tdengine.RealData;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DynamicRealDataMapper extends BaseMapper<RealData>{

	@Insert("insert into #{tablename} using #{supertablename} TAGS (#{groupid}) values(#{idTime}, #{equipmentCode}, #{meteId}, #{meteCode}, #{meteName}, #{value}, #{generateTime}, #{reportTime}, #{createTime}, #{updateTime}, #{meteType})")
	int insertOne(RealData realdata);

	@Select("select * from #{tableName} where reporttime between  #{start} and #{end} ")
	List<RealData> selectByTableName(@Param("tableName") String tableName, @Param("start") Date start, @Param("end") Date end);

	@Select("select * from t_data where idtime > #{idTime}")
	List<RealData> selectByIdTime(Timestamp idTime);

	@Select("select * from t_data ")
	List<RealData> selectAll();
}
